﻿namespace Miao.ML
{
	public class LongData : WinMLData, IImplicitConversionToFloat, IImplicitConversionToDouble
	{
		public long value { get; set; }

		public sealed override DataType type => DataType.Long;

		float IImplicitConversionToFloat.floatValue => value;

		double IImplicitConversionToDouble.doubleValue => value;

		public static string ToString(object value)
		{
			return $"{value}{'L'}";
		}

		public LongData()
		{
		}

		public LongData(long value)
		{
			this.value = value;
		}

		public override void SetValueByText(string text)
		{
			value = long.Parse(text);
		}

		public override string ToString()
		{
			return ToString(value);
		}
	}
}
